<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "goods".
 *
 * @property integer $id
 * @property integer $active_id
 * @property string $title
 * @property string $description
 * @property string $img
 * @property integer $price_normal
 * @property integer $price_discount
 * @property integer $num_total
 * @property integer $num_user
 * @property integer $num_left
 * @property integer $sys_dateline
 * @property integer $sys_lastmodify
 * @property integer $sys_status
 * @property string $sys_ip
 */
class Goods extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'goods';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['active_id', 'price_normal', 'price_discount', 'num_total', 'num_user', 'num_left', 'sys_dateline', 'sys_lastmodify', 'sys_status'], 'integer'],
            [['title', 'description', 'img', 'sys_ip'], 'required'],
            [['description'], 'string'],
            [['title', 'img'], 'string', 'max' => 255],
            [['sys_ip'], 'string', 'max' => 50]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'active_id' => 'Active ID',
            'title' => 'Title',
            'description' => 'Description',
            'img' => 'Img',
            'price_normal' => 'Price Normal',
            'price_discount' => 'Price Discount',
            'num_total' => 'Num Total',
            'num_user' => 'Num User',
            'num_left' => 'Num Left',
            'sys_dateline' => 'Sys Dateline',
            'sys_lastmodify' => 'Sys Lastmodify',
            'sys_status' => 'Sys Status',
            'sys_ip' => 'Sys Ip',
        ];
    }
}
